import csv
#数据读入
csvFile = open("vip.csv", "r")
reader = csv.reader(csvFile) 
a = []  
for item in reader:
    a.append(item)
csvFile.close()
#排序
def bubble_sort(d):
    for i in range(1,len(d)):
        for j in range(1,len(d)-i):
            if int(d[j][0])>int(d[j+1][0]):
                temp=d[j]
                d[j]=d[j+1]
                d[j+1]=temp
#二分查找
def bsearch(s,array):
    i = 1               #查找范围不包含第一行数据
    j = len(array)-1
    while i <= j:
        m = (i+j) //2
        if int(array[m][0]) ==s:
            return m
        if s < int(array[m][0]):
            j = m-1
        else:
            i = m + 1
    return -1         #未找到返回-1
bubble_sort(a)
key=int(input('请输入要查询的VIP号：'))
m=bsearch(key,a)
if m !=-1:
    print(a[m][1],"先生/女士,您的积分为：",a[m][3]) 
else:
    print('找不到VIP号对应的用户信息！')